package com.nice.nice201110.service;

import com.nice.nice201110.entity.TUserRoleSet;
import com.nice.nice201110.mapper.TUserRoleSetMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class TUserRoleSetService {

    @Autowired
    TUserRoleSetMapper tUserRoleSetMapper;

    //获取该用户对应的角色信息
    public List<TUserRoleSet> getListByUserID(Integer userid){
        return tUserRoleSetMapper.selectByUserid(userid);
    }
    //往角色插入对应用户
    public Boolean insert(TUserRoleSet tUserRoleSet){
        Integer tUserRoleSetNum = tUserRoleSetMapper.insertSelective(tUserRoleSet);
        if(tUserRoleSetNum<=0){
            return false;
        }
        return true;
    }

}
